import { defineStore } from "pinia"
import { ref } from 'vue'

export const useGoodsInfoStore = defineStore(
    'goodsInfo',
    () => {
        //定义goodsInfo
        const goodsInfo = ref([])

        //设置goodsInfo的值
        function setGoodsInfo (newGoodsInfo: any) {
            goodsInfo.value = newGoodsInfo
        }

        //移除goodsInfo的值
        function removeGoodsInfo () {
            goodsInfo.value = []
        }

        return {
            goodsInfo, setGoodsInfo, removeGoodsInfo
        }
    },
    {
        persist:true
    }
)